package app.main;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Main extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        FileList _FileList = new FileList(this);
        _FileList.setOnPathChangedListener(_OnPathChanged);
        _FileList.setOnFileSelected(_OnFileSelected);
        
        LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout01);
        layout.addView(_FileList);
        
        _FileList.setPath("/");
        _FileList.setFocusable(true);
        _FileList.setFocusableInTouchMode(true);       
        
    }
    
    private OnPathChangedListener _OnPathChanged = new OnPathChangedListener() {
		@Override
		public void onChanged(String path) {
			((TextView) findViewById(R.id.TextView01)).setText(path);
		}
	};
    
    private OnFileSelectedListener _OnFileSelected = new OnFileSelectedListener() {
		@Override
		public void onSelected(String path, String fileName) {
			// TODO
		}
	};
    
}